/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


package Model;

import java.io.Serializable;
import javax.persistence.*;

@Entity
@Table(name="customer")
@NamedQuery(name="getAll", query = "SELECT p FROM Customer p")
public class Customer implements Serializable, Comparable <Customer>{
   
    public Customer(){}
    public Customer(String name, String lastname, String address, String phone, String email, String sex, String password){
        this.name = name;
        this.lastname = lastname;
        this.address = address;
        this.phone = phone;
        this.email = email;
        this.sex = sex;
        this.password = password;
       
}
  
        
 
@Id @GeneratedValue
@Column (name="id")
private String id;
@Column(name="name")
private String name;
@Column(name="lastname")
private String lastname;
@Column(name="address")
private String address;
@Column(name="phone")
private String phone;
@Column(name="email")
private String email;
@Column(name="sex")
private String sex;
@Column(name="password")
private String password;

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the lastname
     */
  
    public String getLastname() {
        return lastname;
    }

    /**
     * @param lastname the lastname to set
     */
    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    /**
     * @return the address
     */
    public String getAddress() {
        return address;
    }

    /**
     * @param address the address to set
     */
    public void setAddress(String address) {
        this.address = address;
    }

    /**
     * @return the phone
     */
    public String getPhone() {
        return phone;
    }

    /**
     * @param phone the phone to set
     */
    public void setPhone(String phone) {
        this.phone = phone;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return the sex
     */
    public String getSex() {
        return sex;
    }

    /**
     * @param sex the sex to set
     */
    public void setSex(String sex) {
        this.sex = sex;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @param password the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }

  
   

    public Customer(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public int compareTo(Customer cust) {
        
     return this.getName().compareToIgnoreCase((String) cust.getName());
    }

    
}
